package cj.web.tel.service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import cj.web.tel.dao.GroupInforDAO;
import cj.web.tel.domain.GroupInfor;

@Service
public class GroupInforService {

	@Autowired
    private GroupInforDAO groupInforDAO;
	
	public List<GroupInfor> queryAll(){
		return groupInforDAO.queryAll();
	}
	
	public List<GroupInfor> queryAllNotPid(){
		return groupInforDAO.queryAllNotPid();
	}
	
	/**
	 * 查询
	 * @param groupInfor
	 * @return groupInforlis;size
	 */
	public Map query(GroupInfor groupInfor){
		Map rep = new HashMap();
		List<GroupInfor> categorylis = groupInforDAO.query(groupInfor);
		int size = groupInforDAO.querySize(groupInfor); 
		rep.put("groupInforlis", categorylis);
		rep.put("size", size);
		return rep;
    }
	
	public GroupInfor queryById(int id){
		GroupInfor obj = groupInforDAO.queryById(id);
		return obj;
    }
	
	public void create(GroupInfor groupInfor){
		groupInforDAO.create(groupInfor);
	}
	
	public void update(GroupInfor groupInfor){
		groupInforDAO.update(groupInfor);
	}
	
	public void deleteById(int id){
		groupInforDAO.deleteById(id);
	}
}
